#include "stdafx.h"
#include "HTMList.h"


CHTMList::CHTMList(void)
{
	m_currPosition = NULL;
}


CHTMList::~CHTMList(void)
{
}


bool CHTMList::StartOver(void)
{
	m_currPosition = this->GetHeadPosition();
	if (m_currPosition == NULL)
		return false;
	else
		return true;
}


bool CHTMList::IsFirst(void)
{
	if (m_currPosition == this->GetHeadPosition())
		return true;
	return false;
}


bool CHTMList::IsLast(void)
{
	if (m_currPosition == this->GetTailPosition())
		return true;
	return false;
}


HTMITEM CHTMList::GetNext(void)
{
	//TODO: insert return statement here
	HTMITEM item;

	item = CList::GetNext(m_currPosition);
/*	if (m_currPosition == NULL)
		MessageBeep(0);
		MessageBeep(0);
		MessageBeep(0);
		MessageBeep(0);
		MessageBeep(0);*/
	return item;

}


HTMITEM CHTMList::GetPrev(void)
{
	//TODO: insert return statement here
	HTMITEM item;

	item = CList::GetPrev(m_currPosition);
	return item;
}


CString CHTMList::GetCurrentID(void)
{
	HTMITEM item;

	item = CList::GetAt(m_currPosition);
	return item.item_id;
}


CString CHTMList::GetCurrentFilePath(void)
{
	HTMITEM item;
	if (m_currPosition == NULL)
		return _T("");

	item = CList::GetAt(m_currPosition);
	return item.item_name;
}


int CHTMList::GetCurrentIndex(void)
{
	HTMITEM item;
	if (m_currPosition == NULL)
		return -1;

	item = CList::GetAt(m_currPosition);
	return item.item_index;
}
